package spec.lijunyao.unit5.collection;

import java.util.Calendar;
import java.util.GregorianCalendar;

import static jdk.nashorn.internal.parser.DateParser.DAY;

public class IncludeClassTest {
    public static void main(String[] args) {
        //Math类测试
        System.out.println("正弦值："+Math.sin(Math.PI/5));
        System.out.println("平方根："+Math.sqrt(1000));
        System.out.println("2的十次方根："+Math.pow(2,10));
        System.out.println("100.9向下取整为："+Math.ceil(100.9));
        System.out.println("100.1向上取整为："+Math.floor(100.1));
        System.out.println("100.4四舍五入为："+Math.round(100.4));
        System.out.println("100.5四舍五入为："+Math.round(100.5));
        //StringBuffer类测试
        StringBuffer s=new StringBuffer("abcd\nefghijk");
        System.out.println(s.length());
        System.out.println(s);
        s.insert(1,"M");
                System.out.println(s);
                s.delete(1,2);
                System.out.println(s);
                s.replace(12,14,"cb");
                System.out.println(s);
                GregorianCalendar x=new GregorianCalendar();
                String time=x.get(Calendar.YEAR)+"年"+x.get(Calendar.MONTH)+"月"+x.get(Calendar.DATE)+"日"+x.get(Calendar.HOUR_OF_DAY)+":"+x.get(Calendar.MINUTE);
                System.out.println(time);
    }
}
